package cfg.mpsc;
import cfg.mpsc.IEdge;
import cfg.mpsc.INode;


public class IEdgeImpl implements IEdge {

	
	public static final IEdge BEGIN = new IEdgeImpl(null,null){
		public String toString(){
			return "begin";
		}
	};
	public static final IEdge END = new IEdgeImpl(null,null){
		public String toString(){
			return "end";
		}
	};
	
	private INode to;
	private INode from;
	
	public IEdgeImpl(INode from, INode to){
		this.from = from;
		this.to=to;
	}
	
	
	@Override
	public INode to() {
		return to;
	}

	@Override
	public INode from() {
		return from;
	}

	public String toString(){
		return "("+from+","+to+")";
	}
	
	
	public Object clone(){
		IEdge cln = new IEdgeImpl(from,to);
		return cln;
	}
	
}
